//教师接口封装
import request from '../../utils/request';

/** 教师列表查询 */
export function useListApi(data: object) {
    return request({
        url: '/pc/teacher/list',
        method: 'post',
        data,
    });
}

/** 教师删除 */
export function useDeleteApi(data: { ids: React.Key[] }) {
    // 将ID数组转换为逗号分割的字符串
    const idsStr = data.ids.join(',');
    return request({
        url: '/pc/teacher/del',
        method: 'post',
        data: { ids: idsStr },
    });
}

/** 教师新增/编辑 */
export function useAddApi(data: object) {
    return request({
        url: '/pc/teacher/save',
        method: 'post',
        data,
    });
}